{include file="header.html"}
<div class="row">
	<div class="span12">
    <ul class="nav nav-tabs">
    	<li class="active"><a href="{$appadmin}?m=user">用户管理</a></li>
        <li><a href="{$appadmin}?m=user&a=add">用户添加</a></li>
    </ul>
    <h3><small>共{$rscount}条记录</small></h3>
    <div>
    <form method="get" action="{$appadmin}" class="form form-inline">
    <input type="hidden" name="m" value="user" />
    userid:<input type="text" name="userid" value="{$smarty.get.userid|intval}" style="width:50px" />
    昵称：<input type="text" name="nickname" value="{$smarty.get.nickname|email}" />
    排序：<select name="orderby">
    	<option value="userid DESC">注册</option>
    	<option value="money DESC">余额</option>
        <option value="gold DESC">金币</option>
        <option value="grade DESC">积分</option>
    </select>
    <input type="submit" value="搜索" class="btn btn-success" />
    </form>
    </div>
    <table class="table table-bordered" width="100%">
    	<tr>
        <td >ID</td>
        <td>账号</td>
        <td>昵称</td>
        <td>电话</td>
        <td>账户余额</td>
        <td>金币</td>
        <td>积分</td>
        <td >状态</td>
        <td>注册时间</td>
        <td >类型</td>
        <td width="100 ">操作</td>
        </tr>
       {foreach item=c from=$data}
       <tr>
        <td>{$c.userid}</td>
        <td>{$c.username}</td>
        <td>{$c.nickname}</td>
        <td>{$c.telephone}</td>
        <td>{$c.money}</td>
        <td width="8%">{$c.gold}</td>
        <td width="8%">{$c.grade}</td>
        <td>{if $c.status eq 1}已通过{elseif $c.status eq 10}未审核{else}已禁止{/if}</td>
        <td>{$c.dateline|date:Y-m-d}</td>
        <td>{$user_type_list[$c.user_type]}</td>
        <td> <a href="{const.APPADMIN}?m=user&a=add&userid={$c.userid}">编辑</a>  
        <a href="javascript:;" class="setLogin" url="{const.APPADMIN}?m=user&a=login&userid={$c.userid}&ajax=1" >切换登陆</a>
        <br>
        <a href="{const.APPADMIN}?m=recharge&a=man&userid={$c.userid}" >充值</a>
        <a href="{const.APPADMIN}?m=gold_log&a=man&userid={$c.userid}">充积分</a>
        </td>
        </tr>
       {/foreach} 
    
    </table>
    {$pagelist}
    </div>
</div>
<script>
$(function(){
	$(".setLogin").on("click",function(){
		$.get($(this).attr("url"),function(data){
			skyToast('切换登录成功');
		});
	});
})
</script>
{include file="footer.html"}